﻿@{
    ViewBag.Title = "菜肴选择";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.nbGridFor<DishRange>(s=>
 {
    s.ID("gridList");
    s.Action(@Url.Action("DishList", new { Date = ViewBag.Date }));
    s.Height("document.documentElement.clientHeight-86");
    s.ShowCheckBox(false);
    s.Columns(col =>
    {
        //col.Bind(e => e.Id, "选择", 20).Sortable(false)
        //    .Template(Url.("check", "", "Selected('${Id}')"));
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.DishId).Hide();
        col.Bind(e => e.Code).Width(60).AsQuery();
        col.Bind(e => e.Name).Width(80).AsQuery().Align(GridAlign.Left);
        col.Bind(e => e.Category).EnumKey("DishType").Width(100);
        col.Bind(e => e.DishCost).Width(50).Align(GridAlign.Right);
        col.Bind(e => e.DishPrice).Width(50).Align(GridAlign.Right);
        col.Bind(e => e.Date).Width(80).DateFormat("yyyy-MM-dd");
    });
 }))
<script type="text/javascript">
    function Selected(id) {

        CloseModalDialog(null, true, $("#gridList").flexGetRowData(id));
    }
</script>
